import {
    defineComponent,
    type PropType,
    ref,
} from 'vue'
import{ type fieldConfig} from "../type";
export default defineComponent({
    name: 'wt_input',
    props:{
      name:{type:String,default:"",requied:true},
      placeholder:{type:String,default:"",requied:true},
      disabled:{type:Boolean,default:false,requied:true},
      fieldConfig:{
        type:Object as PropType<fieldConfig>,
        required:false,
        default:()=>({})
      },
      dataObj: {type:Object,default:()=>({}),  required:true,},
    },
   
    setup(props, ctx) {
        const myValue = ref<string | number>(props.dataObj[props.name])
        return()=>(
            <a-input v-model:value={myValue.value} {...props.fieldConfig} disabled={props.disabled} placeholder={props.placeholder}>                          
            </a-input>
        )
     }
})
